package com.durian.system.api.factory;

import com.durian.system.api.RemoteRoleService;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteRoleFallBackFactory implements FallbackFactory<RemoteRoleService> {
    private static final Logger log = LoggerFactory.getLogger(RemoteRoleFallBackFactory.class);
    @Override
    public RemoteRoleService create(Throwable cause) {
        log.error("菜单服务调用失败：{}",cause.getMessage());
        return new RemoteRoleService() {
            @Override
            public String timedTask() {
                return null;
            }
        };
    }
}
